﻿<%@ Page Language="C#" MasterPageFile="~/TapuKadastro.master" AutoEventWireup="True"
    Inherits="TapuKadastroWeb.MusteriKayit" Title="Müşteri Bilgileri" CodeBehind="MusteriKayit.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/UserControls/Tarih.ascx" TagName="Tarih" TagPrefix="uc2" %>
<%@ Register Src="~/UserControls/Sayi.ascx" TagName="Sayi" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPH" runat="server">
    <h3 class="title">
        Müşteri Bilgileri
    </h3>
    <asp:MultiView ID="mv" runat="server" ActiveViewIndex="0">
        <asp:View ID="vListe" runat="server">
            <table class="form">
                <tr>
                    <td class="label">
                        Müşteri Tipi
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID ="ddlMusteriTipi"> </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Adı
                    </td>
                    <td>
                        <asp:TextBox ID="txtAdiARA" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Soyadı
                    </td>
                    <td>
                        <asp:TextBox ID="txtSoyadiARA" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        TC Kimlik No
                    </td>
                    <td>
                        <asp:TextBox ID="txtTCKimlikNoARA" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Vergi No
                    </td>
                    <td>
                        <asp:TextBox ID="txtVergiNoARA" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnListele" runat="server" Text="Listele" OnClick="btnListele_Click" />
                        <asp:Button ID="btnYeniKayit" runat="server" Text="Yeni Kayıt" CausesValidation="False"
                            OnClick="btnYeniKayit_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView ID="grdMusteriListe" runat="server" AutoGenerateColumns="False" Width="100%"
                CssClass="grid" AllowPaging="True" DataKeyNames="MusteriID" PageSize="20" EmptyDataText="Aranılan kriterlere uygun sonuç bulunamadı."
                OnPageIndexChanging="grdMusteriListe_PageIndexChanging" OnRowCommand="grdMusteriListe_RowCommand"
                OnRowDataBound="grdMusteriListe_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="MusteriTipi" HeaderText="Müşteri Tipi" />
                    <asp:BoundField DataField="Adi" HeaderText="Adı" />
                    <asp:BoundField DataField="Soyadi" HeaderText="Soyadı" />
                    <asp:BoundField DataField="TCKimlikNo" HeaderText="TC Kimlik No" />
                    <asp:BoundField DataField="VergiNo" HeaderText="Vergi No" />
                    <asp:BoundField DataField="Unvani" HeaderText="Unvanı" />
                    <asp:BoundField DataField="TelefonNo" HeaderText="Telefon No" />
                    <asp:ButtonField ControlStyle-CssClass="grd_Guncelle" CommandName="duzenle" Text="Güncelle" />
                    <asp:ButtonField ControlStyle-CssClass="grd_Sil onay" CommandName="sil" Text="Sil" />
                </Columns>
                <RowStyle CssClass="even" />
                <AlternatingRowStyle CssClass="odd" />
                <EditRowStyle CssClass="odd" />
                <EmptyDataRowStyle CssClass="empty" />
            </asp:GridView>
        </asp:View>
        <asp:View ID="vKayit" runat="server">
            <table class="form">
                <tr>
                    <td class="label">
                        Müşteri Tipi
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlMusteriTipiKayit" runat="server"> </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvMusteriTipi" runat="server" ControlToValidate="ddlMusteriTipiKayit"
                            Text="Müşteri Tipini Seçiniz" InitialValue="-1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Adı
                    </td>
                    <td>
                        <asp:TextBox ID="txtAdi" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvAdi" runat="server" ControlToValidate="txtAdi"
                            Text="Adını Giriniz"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Soyadı
                    </td>
                    <td>
                        <asp:TextBox ID="txtSoyadi" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvSoyadi" runat="server" ControlToValidate="txtSoyadi"
                            Text="Soyadını Giriniz"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        TC Kimlik No
                    </td>
                    <td>
                        <asp:TextBox ID="txtTCKimlikNo" runat="server" CssClass="int" MaxLength="11"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvTCKimlikNo" runat="server" ControlToValidate="txtTCKimlikNo"
                            Text="TC Kimlik No Giriniz"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="rvTCNo" runat="server" ErrorMessage="RangeValidator" ControlToValidate="txtTCKimlikNo"
                             Display="Dynamic" MaximumValue="1000000000000" MinimumValue="10000000000" Type="Double" > TC Kimlik No 11 hane olmalıdır.</asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Vergi No
                    </td>
                    <td>
                        <asp:TextBox ID="txtVergiNo" runat="server" CssClass="int" MaxLength="10"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvVergiNo" runat="server" ControlToValidate="txtVergiNo"
                            Text="Vergi No Giriniz"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="rvVergiNo" runat="server" ErrorMessage="RangeValidator" ControlToValidate="txtVergiNo"
                             Display="Dynamic" MaximumValue="10000000000" MinimumValue="1000000000" Type="Double" > Vergi No 10 hane olmalıdır.</asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Unvanı
                    </td>
                    <td>
                        <asp:TextBox ID="txtUnvani" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvUnvani" runat="server" ControlToValidate="txtUnvani"
                            Text="Unvanı Giriniz"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Telefon No
                    </td>
                    <td>
                        <telerik:RadMaskedTextBox ID="txtTelefonNo" runat="server" Font-Size="Small" Mask="(###)-###-####"
                            AllowEmptyEnumerations="false">
                        </telerik:RadMaskedTextBox>
                        <asp:RequiredFieldValidator ID="rfvTelefonNo" runat="server" ControlToValidate="txtTelefonNo"
                            Text="Telefon No Giriniz"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Adres
                    </td>
                    <td>
                        <asp:TextBox ID="txtAdres" runat="server" Width="450px" TextMode="MultiLine" Height="70px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="buton" colspan="2">
                        <asp:Button ID="btnGeri" runat="server" CssClass="btn_back" Text="Geri" CausesValidation="False"
                            OnClick="btnGeri_Click" />
                        <asp:Button ID="btnKaydet" runat="server" Text="Kaydet" OnClick="btnKaydet_Click" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
</asp:Content>
